Get the corresponding information from date, and get the corresponding information from date
Create a test table:
Create or replace view v ASSELECT TO_DATE ('2017-5-5 13:14:15 ', 'yyyy-MM-DD HH24: MI: ss') AS c from dual; SELECT * FROM v;
The
Date D=new date ();SimpleDateFormat df=new SimpleDateFormat ("Yyyy-mm-dd");System.out.println ("Today's Date:" +df.format (d));System.out.println ("Two days ago Date:" + Df.format (new Date (D.gettime ()-(LONG) 2 * 24 * 60 * 60 *
Year (birthday), get yearsMonth (birthday), get monthlyDay (birthday), getThe premise is that this birthday is a date Type field.The Sno, sname and Sbirthday of all the students who were born in the same year were queried and studied for the student
In Java Development, we often use the long type to save the time for convenience. currentTimeMillis () or java. util. date. getTime (). The value is the number of milliseconds between the current date and the 1970-01-01. However, in Oracle, the
Obtain corresponding information from dateCreate a test table:
Create or replace view v ASSELECT TO_DATE ('2017-5-5 13:14:15 ', 'yyyy-MM-DD HH24: MI: ss') AS c from dual; SELECT * FROM v;
The SQL code is as follows:
When SELECT c, TO_CHAR (c, '
The following is the original post http://www.cnblogs.com/richinger/articles/113085.html
In programming, you often need to convert the date variable into a string.Convert to strings of different formatsBelow are some common conversions and
Document directory
General functions
Function for testing sequence capacity
Equals, union, intersection and except T
Aggregate functions
Generation sequence Functions
Access Functions
Name
Description
FN: node-Name (node)
I. Oracle Foundation 1.1 DDL (data definition Language) Definition language Create DROP,DESC (note that this operation can only be performed in PL/SQL Developer command Windows and cannot be performed in the Windows window) table tablename1.2 DML
Hql functions and hql Functions
Serial number
Function Name
Description
Type
Supported
Usage
Remarks
1
ABS (n)
Take absolute value
Mathematical functions
JPAQL HQL
ABS (column_name [numeric object
If you want to get the difference between the earliest time of the day and the number of the latest time, you can refer.
If you want to get the difference between the earliest time of the day and the number of the latest time, you can refer.
The
MySQL
For the value range of each type and the valid format of the specified date value, see 7.3.6 Date and Time type.
Here is an example of using the date function. The following query Selects all records. The value of date_col is within the last 3
The table structure is as follows:Number date8 2009/1/117 2009/1/116 2009/1/11 12: 005 2009/1/114 2009/1/12 4:003 2009/1/12 10: 002 2009/1/12 12:001 2009/1/11The result is as follows:Difference23Copy codeThe Code is as follows:Create table #
Table structure is as follows
Number Date
8 2009/1/11 2:00
7 2009/1/11 5:00
6 2009/1/11 12:00
5 2009/1/11 18:00
4 2009/1/12 4:00
3 2009/1/12 10:00
2 2009/1/12 12:00
1 2009/1/11 17:00
The difference between the number of the earliest and the latest
For the description of the valid format of the value range of each type and the specified date and time value, see 7.3.6 Date and Time type.
For the description of the valid format of the value range of each type and the specified date and time
For the description of the valid format of the value range of each type and the specified date and time value, see 7.3.6 date and time type. Here is an example of using the date function. The following query selects all records. The value of
In Mysql, the date and time function applications do not need to ask for help. For more information about mysql learning, see.
In Mysql, the date and time function applications do not need to ask for help. For more information about mysql learning,
MYsql Date and Time Functions
MYsql Date and Time Functions
For the description of the valid format of the value range of each type and the specified date and time value, see 7.3.6 Date and Time type.
Here is an example of using the date function.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.